package Submarine;

import javax.swing.*;
import java.util.Random;

/** 炸弹 */
public class Bomb extends SeaObject {
    public Bomb(int x,int y){
        super(x,y,5,9,12);
    }

    @Override
    public void move() {
        y+=speed;
    }
    public ImageIcon getImage(){
        return Images.bomb;
    }
    public boolean isOutofBounds(){return y>World.HEIGHT;}
}
/**
 * 案例练习
 * int width;
 * int height;
 * int x;
 * int y;
 * int speed;
 * Bomb(int x,int y){
 *     width=9;
 *     height=12;
 *     this.x=x;
 *     this.y=y;
 *     speed=5;
 * }
 */
















